﻿namespace Command_Pattern
{
    internal class Program
    {
        /// <summary>
        /// 将一个请求封装为一个对象，从而使你可用不同的请求对客户进行参数化
        /// 对请求排队或记录请求日志，以及支持可撤销的操作
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Barbecuer boy = new Barbecuer();
            //原型
            Command bakeMuttonCommand = new BakeMuttonCommand(boy);
            Command bakeHotDogCommand = new BakeHotDogCommand(boy);
            Command bakeChickenWingCommand = new BakeChickenWingCommand(boy);
            Waiter waiter = new Waiter();

            //客户1
            Command person1ChickenWing = (Command)bakeChickenWingCommand.Clone();
            person1ChickenWing.SetCount(6);
            Command person1HotDog = (Command)bakeHotDogCommand.Clone();
            person1HotDog.SetCount(7);
            waiter.SetOrder(person1ChickenWing);
            waiter.SetOrder(person1HotDog);


            //客户2
            Command person2ChickenWing = (Command)bakeChickenWingCommand.Clone();
            person2ChickenWing.SetCount(6);
            Command person2HotDog = (Command)bakeHotDogCommand.Clone();
            person2HotDog.SetCount(7);
            Command person2Mutton = (Command)bakeMuttonCommand.Clone();
            person2Mutton.SetCount(12);
            waiter.SetOrder(person2ChickenWing);
            waiter.SetOrder(person2HotDog);
            waiter.SetOrder(person2Mutton);



            Console.Read();


        }
    }
}
